/*
 * @Description:
 * @Author:
 * @Date: 2024-10-26 20:42:52
 * @LastEditTime: 2024-12-08 02:43:15
 * @LastEditors: XXX
 */
import { createApp } from 'vue'

interface PluginModule {
  default: (app: ReturnType<typeof createApp>) => void
}


export async function loadAllPlugins (app: ReturnType<typeof createApp>) {
  // const files = require.context('.', true, /\.ts$/)
  const modules = import.meta.glob('./*.ts', { eager: true }) as Record<string, PluginModule>
  for (const path in modules) {
    const module = (await modules[path]) as PluginModule
    module.default(app)
  }
}
